const Koa = require('koa');
const assets = require('./assets');
const views = require('./views');
const proxy = require('./proxy');
const router = require('./router');
const server = require('./server');
const app = new Koa();

// 静态资源
assets(app);

// 视图
views(app);

// 跨域代理
proxy(app);

// 路由
app.use(router.routes()).use(router.allowedMethods());

// 启动服务器
server(app);